package com.ruoyi.mobile.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mobile.mapper.TakeMedicineRecordMapper;
import com.ruoyi.mobile.domain.TakeMedicineRecord;
import com.ruoyi.mobile.service.ITakeMedicineRecordService;

/**
 * 用药打卡记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-20
 */
@Service
public class TakeMedicineRecordServiceImpl implements ITakeMedicineRecordService 
{
    @Autowired
    private TakeMedicineRecordMapper takeMedicineRecordMapper;

    /**
     * 查询用药打卡记录
     * 
     * @param id 用药打卡记录主键
     * @return 用药打卡记录
     */
    @Override
    public TakeMedicineRecord selectTakeMedicineRecordById(Integer id)
    {
        return takeMedicineRecordMapper.selectTakeMedicineRecordById(id);
    }

    /**
     * 查询用药打卡记录列表
     * 
     * @param takeMedicineRecord 用药打卡记录
     * @return 用药打卡记录
     */
    @Override
    public List<TakeMedicineRecord> selectTakeMedicineRecordList(TakeMedicineRecord takeMedicineRecord)
    {
        return takeMedicineRecordMapper.selectTakeMedicineRecordList(takeMedicineRecord);
    }

    /**
     * 新增用药打卡记录
     * 
     * @param takeMedicineRecord 用药打卡记录
     * @return 结果
     */
    @Override
    public int insertTakeMedicineRecord(TakeMedicineRecord takeMedicineRecord)
    {
        takeMedicineRecord.setCreateTime(DateUtils.getNowDate());
        return takeMedicineRecordMapper.insertTakeMedicineRecord(takeMedicineRecord);
    }

    /**
     * 修改用药打卡记录
     * 
     * @param takeMedicineRecord 用药打卡记录
     * @return 结果
     */
    @Override
    public int updateTakeMedicineRecord(TakeMedicineRecord takeMedicineRecord)
    {
        return takeMedicineRecordMapper.updateTakeMedicineRecord(takeMedicineRecord);
    }

    /**
     * 批量删除用药打卡记录
     * 
     * @param ids 需要删除的用药打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteTakeMedicineRecordByIds(Integer[] ids)
    {
        return takeMedicineRecordMapper.deleteTakeMedicineRecordByIds(ids);
    }

    /**
     * 删除用药打卡记录信息
     * 
     * @param id 用药打卡记录主键
     * @return 结果
     */
    @Override
    public int deleteTakeMedicineRecordById(Integer id)
    {
        return takeMedicineRecordMapper.deleteTakeMedicineRecordById(id);
    }
}
